/*
 * 数据统计
 * */

import http from '@/utils/http';

//  访问趋势请求
export async function fakeTrendChartData(params) {
  return http.post('/home/visit', params);
}

// 访客分布

export async function fakeChartData(params) {
  return http.post('/chart/userAreaChartJson', params);
}

//  问答详细统计 - 分类统计
export async function fakeSIssueAnswerTatisticsData(params) {
  return http.post('/stat/qaJson', params);
}

//  问答详细统计 - 分类统计 跟新
export async function detailCategoryList(params) {
  return http.post('/detail/categoryList', params);
}

//  问答详细统计 - 详细统计 跟新
export async function detailDetailList(params) {
  return http.post('/detail/detailList', params);
}

// 问答详细统计 导出excel
export async function exportx(params) {
  return http.post('/stat/qa/export', params);
}

//  问答比例统计
export async function ratioSticsData(params) {
  return http.post('/stat/statQAChartJson', params);
}

//  问答记录
export async function fakeAnswerRecordsData(params) {
  return http.post('/stat/chatStatList', params);
}

// 问答记录 -- 关联列表
// export async function fakeAnswerRelevanceData(params) {
//   return http.get('/qa/relqa/list', params);
// }
// export async function fakeAnswerRelevanceDataForHot(params) {
//   return http.get('/hotQa/qa/relqa/list', params);
// }

// 知识点 -- 关联列表
export async function fakeAnswerRelevanceData(params) {
  return http.get('/relQaQa/list', params);
}

// 热点问题 -- 关联列表
export async function fakeAnswerRelevanceDataForHot(params) {
  return http.get('/relQaQa/list', params);
}

// 智能学习 -- 关联列表
export async function fakeAnswerRelevanceDataForCapacity(params) {
  return http.get('/relQaQa/aiLearning/list', params);
}

// 问答记录 -- 关联列表 --关联知识点
export async function fakeAnswerRelevanceknowledgeData(params) {
  return http.post('/stat/qa/record/relationQa', params);
}

// 问答记录 -- 忽略 --关联知识点
export async function doIgoreRecord(params) {
  return http.post('/stat/updateResolveFlag', params);
}

// 问答记录 -- 获取所有医生
export async function doDoctorList(params) {
  return http.get('/stat/getDoctorList', params);
}

// 问答记录 -- 获取所有处理人
export async function doHandlerList(params) {
  return http.get('/stat/getProcessPersonList', params);
}

// 问答记录 -- 关联上下文
export async function fakeAnswerRelevanceUpDownData(params) {
  return http.post('/stat/listSessionChatsJson', params);
}

// 下载
export async function listChat(params) {
  return http.downloadFile('/stat/chat/exportStat', params);
}

// 问答详细统计下载
export async function exportWD(params) {  // /stat/qa/export
  return http.downloadFile('/detail/category/export', params);
}

// 问答详细下载
export async function exportWE(params) {  // /stat/qa/export
  return http.downloadFile('/detail/detail/export', params);
}

//问答统计-获取列表
export async function doStatCount(params) {
  return http.post('/detail/statCount', params);
}

//问答统计-导出
export async function doExportQaStatistics(params) {
  return http.downloadFile('/detail/detail/export', params);
}


/**
 * 问答记录 2.0版本接口
 */
export async function doRecordsList(params) {
  return http.post('/stat/chatRecord/list', params);
}
export async function doRelatedQuestion(params) {
  return http.post('/stat/chatRecord/relate', params);
}
export async function doChatRecords(params) {
  return http.get('/stat/chatRecord/context', params);
}
export async function doExportAnswerRecords(params) {
  return http.downloadFileForPost('/stat/chatRecord/export', params);
}

// 总库 - 总库查询所有租户
export async function getTenantAll(params) {
  return http.get('/sys/tenant/getTenantAll', params);
}

// 总库 - 根据租户Id查租户下面所有应用
export async function getRobotList(params) {
  return http.get('/robot/getRobotList', params);
}

/**
 * 问答知识统计 2.0版本接口
 */
export async function getQaCategoryStatistics(params) {
  return http.post('/statQa/qaCategory/list', params);
}
export async function getQaStatistics(params) {
  return http.post('/statQa/qa/list', params);
}
export async function doExportQaCategoryRecords(params) {
  return http.downloadFileForPost('/statQa/qaCategory/export', params);
}
export async function doExportQaRecords(params) {
  return http.downloadFileForPost('/statQa/qa/export', params);
}

/**
 * 知识导图统计
 */
export async function fetchAtlasStatistics(params) {
  return http.post('/statAtlas/atlas/list', params);
}

export async function doExportAtlasStatistics(params) {
  return http.downloadFileForPost('/statAtlas/atlas/export', params);
}

/**
 * 获取知识导图节点统计
 */
export async function fetchAtlasNodeStatistics(params) {
  return http.post('/statAtlas/node/list', params);
}

export async function doExportAtlasNodeStatistics(params) {
  return http.downloadFileForPost('/statAtlas/node/export', params);
}

/**
 * 多轮会话统计
 */
export async function fetchDialogStatistics(params) {
  return http.post('/statDialog/list', params);
}

/**
 * 多轮会话导出
 */
export async function exportDialogStatistics(params) {
  return http.downloadFileForPost('/statDialog/export', params);
}

/**
 * API调用统计
 */
 export async function getApiCount(params) {
  return http.post('/base/api/record/count', params);
}

export async function getApiRecord(params) {
  return http.get('/base/api/record/list', params);
}

export async function exportApiCount(params) {
  return http.downloadFile('/base/api/record/exportCount', params);
}

export async function exportApiRecord(params) {
  return http.downloadFile('/base/api/record/exportList', params);
}

/**
 * 舆情分析
 */
 export async function statHit(params) {
  return http.get('/statHit/top', params);
}

export async function wordCloud(params) {
  return http.get('/statSegment/wordCloud', params);
}

export async function chartTrend(params) {
  return http.get('/statHit/chart', params);
}

/**
 * 会话记录
 */
export async function getSessionRecordsList(params) {
  return http.post('/session/record/list', params);
}

//获取上下文
export async function getSessionContext(params) {
  return http.get('/session/record/info', params);
}

export async function exportSessionList(params) {
  return http.downloadFileForPost('/session/record/export', params);
}

export async function exportSessionDetail(params) {
  return http.get('/frontsession/detail',params);
}


/**
 * 文档统计
 */
export async function postDocCategoryStatistics(params) {
  return http.post('/statDoc/docCategory/list', params);
}

export async function exportDocCategoryList(params) {
  return http.downloadFile('/statDoc/docCategory/export', params);
}

export async function postDocStatistics(params) {
  return http.post('/statDoc/doc/list', params);
}

export async function exportDocList(params) {
  return http.downloadFile('/statDoc/doc/export', params);
}

/**
 * 表单统计
 */
export async function fetchFormStatistics(params) {
  return http.post('/statForm/list', params);
}

export async function exportFormStatistics(params) {
  return http.downloadFileForPost('/statForm/export', params);
}

/**
 * 获取上下文 - 20241025
 * 会话内容的展示 UI 要与咨询窗保持一致
 * 采用咨询窗的会话历史详情接口
 * @param params 
 * @returns 
 */
export async function getSessionDetail(params) {
  return http.get('/stat/chatRecord/detail', params);
};

/**
 * 获取文档详情【包括附件】
 * @param {*} params 
 * @returns 
 */
export async function getDocFileInfo(params) {
  return http.get('/doc/fileInfo', params);
};